import {request} from "@/utils/request";

export function getChatInfo(userId) {
    return request({
        url: `/message/info/${userId} `,
        method: 'get',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}
export function getUnreadNum() {
    return request({
        url: `/message/unread`,
        method: 'get',
        header:{
            isToken: true,
            repeatSubmit: false
        }
    })
}

export function getChatList(pageSize,current) {
    return request({
        url: `/message/chat/list/${pageSize}/${current}`,
        method: 'get',
        header:{
            isToken: true,
            repeatSubmit: true
        }
    })
}

export function readMessage(fromUserId,toUserId) {
    return request({
        url: `/message/read/${fromUserId}/${toUserId}`,
        method: 'put',
        header:{
            isToken: true,
            repeatSubmit: true
        }
    })
}

export function readAllMessage() {
    return request({
        url: `/message/read/all`,
        method: 'put',
        header:{
            isToken: true,
            repeatSubmit: true
        }
    })
}
